#pragma once

#include <mutex>
#include <tuple>

#include "../../Network/SOM.h"
#include "DisplayBase.h"
#include "../../Math/Matrix.h"

using namespace std;

class CSOMDisplay : public CDisplayBase
{
public:
	CSOMDisplay() = delete;
	CSOMDisplay(int viewRangeLeft, int viewRangeRight, int viewRangeTop, int viewRangeBottom);

	virtual ~CSOMDisplay();

public:
	virtual void Display(HDC hDc);

public:
	void ShowSOMNetwork(shared_ptr<SOM> & som);

protected:
	void CoordXForm(double x, double y, long & viewX, long & viewY);

	void DrawInner(HDC hdc);

protected:
	mutex  m_DataLock;

	int m_DataMatrixWide;
	int m_DataMatrixHigh;

	unsigned long m_DataMatrixByteSize;

	double * m_DataMatrix;

	double m_Left;
	double m_Right;
	double m_Top;
	double m_Bottom;
};